<template>
  <div>
    <div class="userinfo">
      <open-data class="avatar" mode="aspectFit" type="userAvatarUrl"></open-data>
      <!-- <img v-if="userInfo.avatarUrl" :src="userInfo.avatarUrl" background-size="cover" /> -->
      <div class="">
        <!-- {{userInfo.nickName}} -->
        <open-data type="userNickName" lang="zh_CN"></open-data>
      </div>
    </div>
    <button class="mg-f30" type="primary" @click="f.toPage('setting')">设置</button>
  </div>
</template>

<script>
import { mapState, mapMutations } from 'vuex'
export default {
  components: {},
  data() {
    return {
      logs: []
    }
  },
  methods: {
    openSetting(rs) {
      console.log(rs)
    }
  },
  computed: {
    ...mapState(['userInfo'])
  },
  onShow() {},
  mounted() {
    // 分享
    wx.showShareMenu({
      withShareTicket: true
    })
  },
  onTabItemTap(item) {
    this.f.toast('tab点击')
    console.log(item)
  }
}
</script>

<style lang="scss">
.userinfo {
  text-align: center;
  .avatar,
  img {
    display: inline-block;
    width: 80px;
    height: 80px;
    border-radius: 100%;
    overflow: hidden;
  }
}
.nickname{
  font-size: 20px;
}
</style>
